import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DaydjVO, DaydjForm, DaydjQuery } from '@/api/system/daydj/types';

/**
 * 查询喝奶登记列表
 * @param query
 * @returns {*}
 */

export const listDaydj = (query?: DaydjQuery): AxiosPromise<DaydjVO[]> => {
  return request({
    url: '/system/daydj/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询喝奶登记详细
 * @param daydjId
 */
export const getDaydj = (daydjId: string | number): AxiosPromise<DaydjVO> => {
  return request({
    url: '/system/daydj/' + daydjId,
    method: 'get'
  });
};

/**
 * 新增喝奶登记
 * @param data
 */
export const addDaydj = (data: DaydjForm) => {
  return request({
    url: '/system/daydj',
    method: 'post',
    data: data
  });
};

/**
 * 修改喝奶登记
 * @param data
 */
export const updateDaydj = (data: DaydjForm) => {
  return request({
    url: '/system/daydj',
    method: 'put',
    data: data
  });
};

/**
 * 删除喝奶登记
 * @param daydjId
 */
export const delDaydj = (daydjId: string | number | Array<string | number>) => {
  return request({
    url: '/system/daydj/' + daydjId,
    method: 'delete'
  });
};
